using System;
using YoshiBase.Classes;
using jQueryApi;

namespace Yoshi.Classes
{
    public abstract class MagneticView : AbstractView
    {
        protected MagneticView(jQueryObject element, IPage page) : base(element, page)
        {
        }

        /// <summary>
        /// Scoops the data from the manipulator, usually the UI
        /// </summary>
        /// <returns>an object representation of the data</returns>
        public override object ScoopData()
        {
            jQueryObject magEl = jQuery.Select(".MagName");
            if (magEl.Length > 0)
            {
                string name = magEl.GetValue().Trim();
                if (!String.IsNullOrEmpty(name))
                {
                    return new MagList(name, jQuery.Select("#MagList textarea"));
                }
            }
            return null;
        }


    }
}
